package com.efesco.service.zhongheInsure;

import com.bstek.dorado.common.*;
import com.bstek.dorado.data.*;
import com.bstek.dorado.data.db.DBStatement;
import com.bstek.dorado.view.*;
import com.bstek.dorado.view.data.*;
import com.bstek.dorado.view.control.*;

/**
 * openFailViewModel
 */
public class openFailViewModel extends DefaultViewModel {
	public void doUpdateData(ParameterSet parameters)
      throws Exception {
	  Dataset dataset = getDataset("dataset_open_fail");
	  RecordIterator iter = dataset.recordIterator();
	  DBStatement dbs = new DBStatement();
	  while (iter.hasNext()) {
			Record ds = iter.nextRecord();
			if(ds.getBoolean("select")==false)
				continue;
			
			 dbs.setSql("update s_zhonghe_manage set fund_date=null,status=1,input_man=null,input_date=null,transact_memo='',PAY_START_MONTH='',PAY_END_MONTH='' "
							+ "where  status=4 and ZHONGHE_MANAGE_ID="
							+ ds.getValue("ZHONGHE_MANAGE_ID"));
			dbs.execute();
			dbs.setSql("delete from s_zhonghe_manage_ass where ZHONGHE_MANAGE_ID="+ ds.getValue("ZHONGHE_MANAGE_ID"));
			dbs.execute();  
	  }
	  
	  dbs.close();
   // super.doUpdateData(parameters);
  }

}
